package com.teacher.mobile.controller;


import com.teacher.common.CommonResult;
import com.teacher.pojo.dto.devUser.DevLoginDto;
import com.teacher.pojo.dto.deviceUser.DevRegisterDto;
import com.teacher.pojo.dto.wx.WxLoginDto;
import com.teacher.pojo.vo.WxLoginVo;
import com.teacher.pojo.vo.devUser.DevLoginVo;
import com.teacher.security.entity.annotation.WhiteApi;
import com.teacher.service.IDeviceUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jiangzhuohang
 * @since 2025-04-11
 */
@RestController
@RequestMapping("/deviceUser")
@Api(tags = "毕设用户接口")
public class DeviceUserController {

    @Autowired
    private IDeviceUserService deviceUserService;

    @PostMapping("/register")
    @ResponseBody
    @ApiOperation("毕设用户注册")
    @WhiteApi
    public CommonResult<String> register(@RequestBody DevRegisterDto devRegisterDto) throws Exception {
        return deviceUserService.register(devRegisterDto);
    }

    @PostMapping("/login")
    @ResponseBody
    @ApiOperation("毕设用户授权登录")
    @WhiteApi
    public CommonResult<DevLoginVo> wxLogin(@RequestBody DevLoginDto DevLoginDto) throws Exception {
        return deviceUserService.DevLogin(DevLoginDto);
    }
}

